perm filename METAOB[CLS,LSP] blob sn#849380 filedate 1987-11-20 generic text, type T, neo UTF8
\beginSection{Meta-Objects}

The implementation of the \OS\ manipulates metaclasses and invokes
generic functions. The meta-object protocol specifies a set of generic
functions defined by methods on objects; the behavior of those generic
functions defines the behavior of the \OS. The generic functions and
the objects on which their methods are specialized are called {\bit
meta-objects}.  Programming at the meta-object protocol level involves
defining new objects along with methods specialized on them for
generic functions specified to be in the meta-object protocol.

\beginsubSection{Metaclasses}

The {\bit metaclass\/} of an object is the class of its class.  The
metaclass determines the representation of instances of its instances and
the forms of inheritance used by its instances for slot descriptions and
method inheritance.  The metaclass mechanism can be used to provide
particular forms of optimization or to tailor the \CLOS\ for particular
uses.  The protocol for defining metaclasses is discussed in the chapter,
``The \CLOS\ Meta-Object Protocol.''

\endsubSection%{Metaclasses}

\beginsubSection{Standard Metaclasses}

The \CLOS\ provides a number of predefined metaclasses.  These include the
following: {\bf standard-class}, {\bf built-in-class}, and {\bf
structure-class}.

\beginlist

\item{\bull}
The class {\bf standard-class} is the default class of classes defined
by {\bf defclass}.

\item{\bull} The class {\bf built-in-class} is the class whose
instances are classes that have special implementations with
restricted capabilities.  All classes that correspond to the standard
Common Lisp types specified in {\it Common Lisp: The Language\/}
are potentially instances of {\bf built-in-class}.
The predefined Common Lisp type specifiers that are required to have
corresponding classes are listed in Figure~1-1.  It is implementation
dependent whether each of these classes is actually a built-in class.

\item{\bull}
All classes defined by means of {\bf defstruct} are instances of 
{\bf structure-class}.
\endlist

\endsubSection%{Standard Metaclasses}

\beginsubSection{Standard Meta-objects}

The class {\bf standard-object} and instances of the classes {\bf
standard-method} and {\bf standard-generic-function} are standard
meta-objects.

{\bf standard-object}.

\beginlist

\item{\bull}
The class {\bf standard-method} is the default class of methods
defined by {\bf defmethod}.

\item{\bull}
The class {\bf standard-generic-function} is the default class of 
generic functions defined by the method-defining forms {\bf defmethod},
{\bf defgeneric}, {\bf generic-function}, {\bf generic-flet},
{\bf generic-labels}, and {\bf with-added-methods}.

\item{\bull} The class named {\bf standard-object} is an instance of
the class {\bf standard-class} and is a superclass of every class that
is an instance of {\bf standard-class} except itself.

\endlist

\endsubSection%{Standard Meta-objects} 

\endSection%{Meta-Objects}